<script setup lang="ts">

</script>

<template>
<div class="wrapper">
  <div class="main__wrapper">
    <main>
      <h1>The Codepen Times</h1>
      <aside>
        <div>
          <div class="issue">Issue #1</div>
          <div class="date">Tuesday, 26 May, 2024</div>
          <div class="edition">Two memes Edition</div>
        </div>
      </aside>
      <h2 class="title--large main-title">Woman spends too much time on Codepens despite advice; no plans to stop</h2>

      <div class="main-text multi-column">
        <p>Sometimes, Internet users land themselves in an uncommon situation where an app or website can be used for both work and personal situations. Well, a young front-end designer was spending up to 13 hours on the site, Codepen for work and her hobby, which unfortunately, is also coding. </p>
        <p>The designer, whose work includes a <em>To-Do Terrarium</em>, clarified, "Well, I didn't <em> have </em>to use it for work but it was already part of my workflow. It just made sense as it was more efficient." The biggest issue, she said, is that she would hop on Codepen for work, but would get distracted by pens made by others in the community for unexpectedly long periods of time, which then causes her to spend even more time on the site.</p>
        <p> "I mean, that's terrible right?" she asked. Codepen, which brands itself as the best place to build, test, and discover front-end code, has declined to comment at this time.</p>
      </div>

      <a href="#" class="terrarium">
        <figure>
          <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-terrarium.jpg" alt="">
          <figcaption>A to-do list that grows succulents when you've completed a task</figcaption>
        </figure>
      </a>

      <a href="#" class="item-width-image plan long--2">
        <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-floorplan.jpg" />
        <h4>Can you get inspired to make your own floor plans?</h4>

        <div class="multi-column">
          <p>Making a floor Plan with CSS Grid? Talk about using the wrong tool for the job. But I guess this is what happens when someone isn't happy with any of the floor plans found on Pinterest; she'll start making her own for the eventual home that she will never own. Nevertheless, there's a home office with a large window to look out of pensively during rainy days and a ton of "white space" for the cats to run around.</p>
        </div>
      </a>

      <a href="#" class="hogwarts">
        <div class="hogwarts__title">50% Off Hogwarts Express tickets</div>
        <div class="hogwarts__image">
          <!--两个元素都绝对定位了 高度为0 所以相当于隐藏了-->
          <span>Limited time offer</span>
          <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-hogwarts.svg" />
        </div>
      </a>

      <a href="#" class="item-with-image pasta with-border">
        <h4>A pasta menu</h4>
        <p>Everybody loves pasta. It's impossible to not love them, so here are 15 recipes, served with GSAP. Note the easter egg — the menu icon changes according to the pasta that you choose.</p>
      </a>

      <a href="#" class="item-with-image magazine with-border">
        <h4>Marvel at a magazine</h4>
        <p>A tribute of sorts to an era of cool superhero movies, this is a Marvel-themed magazine! Recommended, because it took 45 hours, so you know some serious dedication has been poured into this.</p>
      </a>

      <a href="#" class="item-with-image style">
        <h4>Let's adopt, don't shop</h4>
        <p>Explore a style guide and various page layouts for a pet adoption site in the <em>Style Guide</em> collection. Inspired by the <em>Atomic Design</em> principle, this 8-pen collection includes a 404 page concept, an admin dashboard and what a Twitter user calls a 'media card zen garden'. Each pen comes with five (yes, five) color themes, including the precious dark mode.</p>
      </a>

      <a href="#" class="item-with-image toggles">
        <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-toggle.gif" />
        <h4>Toggles</h4>
        <p>Eight playful toggles to toggle on and off for your amusement. Is it possible to use these on your site and still adhere to assessibility rules? No. But there's a really cute dog one you <em>have </em>to see.</p>
      </a>

      <a href="#" class="menu">
        <figure>
          <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-menu.jpg" />
          <figcaption>See the new and improved menu for toasty!</figcaption>
        </figure>
      </a>

      <a href="#" class="social">
        <img class="social__image" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-social.gif" />
        <div class="social__subtitle">World News</div>
        <div class="social__content">Looks like Covid-19 is gonna be around for a while so here is another friendly reminder to practice social distancing. Oh, and wear a mask! </div>
      </a>

      <div class="item-with-image cssgrid-collection">
        <a href="#" class="cssgrid-collection__image">
          <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-co-grid.jpg" />
        </a>
        <div class="css-collection__content">
          <h4>
            <a href="#">More CSS Grid things like the one . shelves, coupons and more !</a>
          </h4>

          <div class="multi-column-3">
            <p>Get your fill of more CSS Grid items in this collection. There are a total of 32 pens to date... well, 33, if you count this one too. What can you expect in this collection? The hidden gems, in my totally unbiased opinion, are <a href="https://codepen.io/oliviale/full/wbyVWr" target="_blank">the recreation of the Pac-Man layout</a> and <a href="https://codepen.io/oliviale/pen/wbyVWr" target="_blank">coupons inspired by junk mail</a>. A lot of joke items of things that shouldn't be done in CSS Grid, such as <a href="https://codepen.io/oliviale/full/PXGgMG" target="_blank">a shelf</a>? <a href="https://codepen.io/oliviale/full/qggOog" target="_blank">Bathroom tiles wtf</a>? and <a href="https://codepen.io/oliviale/full/bOWqbj" target="_blank">makeup palettes </a>. If you are a cultured person, you will have a chance to enjoy a couple of pens inspired by <a href="https://codepen.io/oliviale/full/JxVZpX" target="_blank">Harry Potter </a>and <a href="https://codepen.io/oliviale/full/RwNdeeQ" target="_blank">Pokemon.</a> On the rare occasion that you are looking at this profile for something you can use in production, you really shouldn't. But, there are <em> some </em>real-world applications, such as <a href="https://codepen.io/oliviale/full/GPXozx" target="_blank">the recipe layout</a>, <a href="https://codepen.io/oliviale/full/pqoEoJ" target="_blank">the product catalog</a>, and <a href="https://codepen.io/oliviale/full/XyqQYL" target="_blank">color palettes for a style guide</a>.</p>
          </div>
        </div>
      </div>

      <div class="sidebar">
        <h3 class="title--big">Hot this month</h3>
        <a href="#" class="pie">
          <img class="pie__image" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-pie.jpg" />
          <div class="pie__subtitle">Food</div>
          <div class="pie__content">
            <h4>Pies for everyone!</h4>
            <p>No man is left behind. There's infinite pie with this one div and a repeating background.</p>
          </div>
        </a>

        <a class="sidebar-item captcha" href="#" target="_blank">
          <h5>Frustrated designer runs amok with Captcha ideas</h5>
          <p>From Tic Tac Toe to solving meme-based questions, this is a different take on how web captchas should be. "I have not successfully picked out all photos of a truck on the first try. Something's gotta change," says the designer, who has requested to remain anonymous.</p>
        </a>

        <a class="sidebar-item slack-ui with-border" href="#" target="_blank">
          <h5>Slack UI gets reverse engineered</h5>
          <p>Another valiant effort to reverse engineer a web app. However, the UI is repurposed to showcase Codepens instead of mock conversations. This is a codepen showcase inception situation.</p>
        </a>

        <a class="workout" href="#" >
          <div class="workout__image"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-workout.jpg" alt="Workout" /></div>
          <div class="workout__blurb">Always failing to keep track of your workouts? </div>
          <div class="workout__title">Use this tool!</div>
        </a>

      </div>

    </main>
  </div>
</div>
</template>

<style scoped lang="scss">
// 优先实现移动端的布局，然后再使用媒体查询实现其他分辨率
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a {
  text-decoration: none;
  display: block;
  color: var(--black);
}
a:hover,
a:focus,
a:active,
a:visited {
  color: var(--black--acc);
}


p {
  line-height: 1.3;
}
p a {
  display: inline;
}

em {
  font-style: italic;
}


img {
  width: 100%;
  filter: grayscale(95%);
  margin-bottom: 0.5rem;
  border: 1px solid var(--black);
  transition: 0.3s ease;
}

.terrarium:hover, .item-with-image:hover, .social:hover, .pie:hover, .workout:hover {
  img {
    filter: grayscale(0);
  }
}

.with-border {
  border-top: 1px solid;
  padding-top: 0.6rem;
}

.wrapper {
  --font: "EB Garamond", serif;
  --font-title: "Playfair Display", serif;
  --font-sans-serif: "Manrope", sans-serif;
  --black: #1c1f33;
  --black--acc: #222;
  --gray: #eee;
  --gray-1: #ededed;

  font-size: 1.1rem;
  background: var(--preview-bg);
  font-family: var(--font);
  color: var(--black);
  background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/paper_fibers.png)
  repeat;
  padding: 4rem 2rem;
  line-height: 1.3;
  text-align: justify;
  column-break-inside: avoid;

  .main__wrapper {
    max-width: 1135px;
    margin: auto;

    main {
      h1 {
        font: 50px/1 "Playfair Display SC";
        text-align: center;
      }
      aside {
        text-align: center;
        padding: 3px 0;
        border: solid var(--black);
        border-width: 2px 0;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin: 1.5rem;

        & > div {
          display: flex;
          align-items: center;
          border: solid var(--black);
          border-width: 1px 0;

          & > div {
            flex: 1;
            padding: 8px;
          }
        }
      }

      .title--large {
        font-family: var(--font-title);
        font-size: 32px;
        font-style: italic;
        text-align: left;
        margin-bottom: 0.8rem;
      }

      .main-text.multi-column {
        margin: 0;

        p {
          margin-bottom: 0.8rem;
        }
      }

      .terrarium {
        margin: 1.5rem 0;

        figure {
          height: 100%;

          img {
            height: 96%;
            object-fit: cover;
            object-position: right;
          }

          figcaption {
            font-style: italic;
            font-size: 90%;
          }
        }
      }

      .item-with-image {
        margin-top: 1.5rem;
        h4 {
          font-size: 24px;
          text-align: left;
          margin-bottom: 0.5rem;
          transition: 0.2s ease;
        }
        &:not(.cssgrid-collection):hover {
          h4 {
            color: white;
            background-color: var(--black);
          }
        }
      }

      .hogwarts {
        text-align: center;
        height: 100%;
        border: 2px solid transparent;
        outline: 3px solid var(--black);
        box-shadow: inset 0 0 0 1px var(--black);
        width: calc(100% - 4px);
        margin: 1.5rem auto;
        overflow: hidden;

        .hogwarts__title {
          font: 800 24px/1 var(--font-sans-serif);
          text-transform: uppercase;
          background: var(--black);
          color: var(--gray);
          padding: 0.8rem 0.8rem 0.9rem;
          transition: 0.2s ease;
        }

        .hogwarts__image {
          height: 100%;
          position: relative;

          img  {
            transform: rotate(60deg);
            height: 150%;
            position: absolute;
            border: 0;
            width: 250%;
            left: -70%;
            bottom: -35%;
          }

          span {
            font-style: italic;
            max-width: 110px;
            position: absolute;
            top: 7%;
            left: 18%;
            font-size: 22px;
            line-height: 0.9;
            transform: rotate(-5deg);
          }
        }

        &:hover {
          outline: 0;
          .hogwarts__title {
            background: transparent;
            color: var(--black);
          }
        }
      }

      .magazine {
        border: 1px solid;
        border-width: 1px 0;
        padding-bottom: 1rem;
      }

      .menu {
        margin: 1.5rem 0;

        figure {
          height: 100%;
          margin: 1em 40px;

          img {
            height: 90%;
            object-fit: cover;
            object-position: left;
          }

          figcaption {
            font-style: italic;
            font-size: 90%;
          }
        }
      }

      .social {
        display: grid;
        grid-template-columns: 1fr 3fr;
        grid-template-rows: max-content auto;
        color: var(--gray);
        text-align: left;

        .social__image {
          margin: 0;
          border: 0;
          grid-row: span 2; // 从0开始占两行
          height: 100%;
          object-fit: cover;
        }

        .social__subtitle {
          background: #999;
          text-transform: uppercase;
          line-height: 1;
          padding: 0.4rem 1rem;
          color: var(--gray);
          font: 14px var(--font-sans-serif);
        }

        .social__content {
          background: #666;
          padding: 1rem;
          color: var(--gray);
          grid-column: 2; // 放在第二列
        }
      }

      .cssgrid-collection {
        display: flex;
        align-content: stretch;
        border-top: 1px solid;
        padding-top: 1rem;

        h4 {
          margin: 0 0 0.8rem;
        }

        .cssgrid-collection__image {
          flex: 0 0 32%;
          margin-right: 1.5rem;

          img {
            height: 100%;
            object-fit: cover;
            object-position: left;
          }
        }

        p {
          a {
            border-bottom: 1px dashed;

            &:hover {
              border-bottom-style: solid;
            }
          }
        }
      }

      .sidebar {
        margin-top: 3rem;
        .pie {
          line-height: 0;
          color: var(--gray);
          text-align: left;

          .pie__image {
            margin: 0;
            border: 0;
            max-height: 15rem;
            object-fit: cover;
          }

          .pie__subtitle {
            background: #999;
            text-transform: uppercase;
            line-height: 1;
            padding: 0.4rem 1rem;
            font: 14px var(--font-sans-serif);
            color: var(--gray);
          }

          .pie__content {
            background: #666;
            padding: 1rem 1rem 1.2rem;
            color: var(--gray);

            p {
              margin-top: 0.5rem;
            }
          }
        }

        .sidebar-item {
          margin: 2rem 0;
          padding: 2rem 0 0;

          h5 {
            text-align: center;
            width: 100%;
            padding: 0.5rem;
            margin: auto;
          }
          p {
            margin-top: 1rem;
          }

          &:hover {
            h5 {
              transition: 0.3s ease;
              background: var(--black);
              color: #fff;
            }
          }
        }

        .workout {
          border: 2px solid transparent;
          outline: 3px solid var(--black);
          box-shadow: inset 0 0 0 1px var(--black);
          width: calc(100% - 4px);
          margin: 3rem auto 0.2rem;

          .workout__image {
            padding: 2px;

            img {
              height: 16rem;
              object-fit: cover;
              object-position: left;
              border: none;
            }
          }

          .workout__blurb {
            font: 22px/1.1 var(--font-sans-serif);
            text-align: center;
            padding: 0.5rem;
            color: var(--black);
            margin: -1rem 0.5rem 0.3rem;
          }

          .workout__title {
            font: 18px/1.1 var(--font-sans-serif);
            text-transform: uppercase;
            text-align: center;
            padding: 1rem;
            background: var(--black);
            color: var(--gray);
            transition: 0.2s ease;
          }

          &:hover {
            outline: 0;
            .workout__title {
              background: transparent;
              color: var(--black);
            }
          }
        }

      }
    }

  }

  // 大于700px 时候的样式
  @media (min-width: 700px) {
    .main__wrapper {

      main {
        display: grid;
        grid-template-columns: repeat(4, 1fr) 23%;
        grid-template-rows: repeat(5, auto);
        grid-gap: 1.2rem;
        .item-with-image {
          margin: 0;
        }
        h1 {
          font: 70px/1 "Playfair Display SC";
          grid-column: 1/-1;
        }
        aside {
          grid-column: 1/-1;
        }
        .main-title {
          grid-column: 1/-1;
        }
        .title--large {
          font-size: 42px;
          margin: 0;
        }

        .terrarium {
          margin: 0 0 1.5rem;
          grid-column: 1 / -1;
        }

        .hogwarts {
          margin: 0;
          grid-row: span 3;
        }
        .menu {
          grid-column: 1/-1;
          grid-row: 13;
        }
        .main-text {
          grid-column: span 5;
        }
        .social {
          grid-column: 1 / -2;
          grid-row: 8 / 9;
        }
        .sidebar {
          grid-column: 1/-1;
          display: flex;
          flex-wrap: wrap;
          justify-content: space-between;
          align-items: flex-start;
          margin: 0;
          h3 {
            width: 100%;
            text-align: center;
          }
          .sidebar-item {
            flex: 0 1 48%;
            margin: 1.5rem 0;
            padding: 0;
            border-top: 0;
          }
          a {
            flex: 0 1 48%;
            margin: 1.5rem 0;
            padding: 0;
            border-top: 0;

            &.pie {
              order: 4;
            }

            &.workout {
              margin-top: 1.5rem;
            }
          }

        }
        .toggles {
          grid-column: 3/6;
          grid-row: 10/13;
        }
        .plan {
          grid-column: span 4;
        }
        .long--2 {
          grid-row: span 2;
        }
        .cssgrid-collection {
          grid-column: 1/-1;
          grid-row: 9;
        }
        .pasta, .magazine, .style {
          grid-column: 1 / 3;
        }
        aside {
          margin: 0;
        }
        .multi-column {
          column-count: 2;
          column-gap: 1.3rem;
          margin-top: 0.75rem;
        }
        .multi-column-3 {
          column-count: 3;
        }
      }

    }
  }

  // 大于 min-width: 1024px 样式
  @media (min-width: 1024px) {
    .main__wrapper {
      main {
        h1 {
          grid-column: 1 / -1;
        }
        aside {
          grid-column: 1 / -1;
        }
        .main-title {
          grid-column: 1 / -2;
        }
        .main-text {
          grid-column: 1 / 3;
          grid-row: 4;
        }
        .terrarium {
          grid-column: 3 / 5;
          grid-row: 4;
        }
        .plan {
          grid-column: 1 / 3;
          grid-row: 5 / 7;
        }
        .hogwarts {
          grid-column: 3 / 4;
          grid-row: 5 / 7;
        }
        .pasta {
          grid-column: 4 / 5;
          grid-row: 5 / 6;
        }
        .magazine {
          grid-column: 4 / 5;
          grid-row: 6 / 7;
        }
        .sidebar {
          grid-column: -2 / -1;
          grid-row: 3 / 9;
          display: block;
          h3 {
            text-align: left;
          }
        }
        .style {
          grid-column: 1 / 2;
          grid-row: 7 / 8;
        }

        .menu {
          grid-column: 2 / 4;
          grid-row: 7 / 8;
        }
        .toggles {
          grid-column: 4 / 5;
          grid-row: 7 / 8;
        }
      }
    }
  }
}
</style>
